package com.bang.itstack.day08;

/**
 * @ClassName: Goods
 * @Desc: 商品(树叶)
 * @author: <Bang>
 * @Date: 2021/10/22 12:02
 * @Version: 1.0
 * @Modified By:
 */
public class Goods implements Articles {

    private String name;     //名字
    private int quantity;    //数量
    private float unitPrice; //单价

    public Goods(String name, int quantity, float unitPrice) {
        this.name = name;
        this.quantity = quantity;
        this.unitPrice = unitPrice;
    }

    @Override
    public float calculation() {
        return quantity * unitPrice;
    }

    @Override
    public void show() {
        logger.info(name + "(数量：" + quantity + "，单价：" + unitPrice + "元)");
    }
}
